﻿@using ZX.Tools
@using ZX.Model
@model ZX.Model.My_Ask
@{
    ViewBag.Title = "完成-指效OA";
    int userId = Session["UserId"].ToInt();
}
<link href="~/dist/lib/datetimepicker/datetimepicker.min.css" rel="stylesheet" />
<link href="/Scripts/layui/css/layui.css" rel="stylesheet" />

<script src="~/Scripts/layer/layer.js"></script>
<script src="~/Scripts/layer/layer.tools.js"></script>
<script src="/Scripts/layui/layui.js"></script>

<form id="doApplyForm" method="post" class="form-horizontal" style="padding-top: 38px;" action="/Temporary_Task/FinishSave">
    <input type="hidden" id="Id" name="Id" value="@Model.Id">
    <input type="hidden" id="secondMenuId" name="secondMenuId" value="@ViewBag.SecondMenuId" />

    <div class="form-group">
        <label for="Assigned" class="col-sm-2">流程选择</label>
        <div class="col-md-6 col-sm-10">
            <select name="Assigned" id="Sel_Assigned" class="form-control">
                <option value="" data-keys=""></option>
                @{
                    try
                    {
                        List<Approval> selectItemsApproval = ViewBag.ListApproval;
                        foreach (var item in selectItemsApproval)
                        {
                            <option value="@item.Id" data-keys="@item.DName">@item.DName</option>
                        }
                    }
                    catch { }
                }
            </select>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <a href='javascript:;' class='btn btn-primary' onclick='saveData()'>提交</a>
        </div>
    </div>

</form>
<script type="text/javascript">

    function saveData() {
        $("#doApplyForm").submit();
    }

    $("#doApplyForm").Validform({
        tiptype: 3,
        callback: function (form) {
            win.showLoading("正在保存...");
            $("#doApplyForm").ajaxSubmit(function (data) {
                if (data.Code == 300) {
                    win.alert("保存失败");
                } else if (data.Code == 200) {
                    win.success("保存成功", function () {
                        win.hideLoading();
                        window.parent.location.reload();//刷新当前页面.
                        win.close();
                    });
                }
            });
            return false;
        }
    });
</script>
